package com.ht.shop.dao;

import com.ht.shop.pojo.TbAddress;
import com.ht.shop.pojo.TbOrder;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AddressDao {
    @Select("SELECT * from tb_address where  uid = #{uid}")
    List<TbAddress> findAllAddressByUid(long uid);
    @Select("insert into tb_address(detail,name,phone,uid) values (#{detail},#{name},#{phone},#{uid})")
    long addAddress(String detail,String name,String phone,long uid);
    @Select("update tb_address set detail=#{detail},name=#{name},phone=#{phone} where id =#{id}")
    long updateAddress(String detail,String name,String phone,long id);
    @Select("delete from tb_address where id = #{id}")
    void deleteAddressById(long id);
    @Select("select * from tb_address")
    List<TbAddress> findAllAddressById() throws Exception;
}
